/*
 * @Author: fishroom
 * @Date: 2021-08-22 20:54:17
 * @LastEditTime: 2021-09-03 00:00:26
 * @FilePath: \index\src\store\home\home.js
 */
import axios from "axios";
export function getRanking({ commit }) {
  axios.get("/api/toplist/detail").then(res => {
    commit("changeRankingList", res.data.list);
  });
}

export function getNewSong({ commit }, cookie) {
  axios.get("/api/personalized/newsong?limit=6&cookie=" + cookie).then(res => {
    commit("getHomeNewSong", res.data.result);
  });
}
export function getNewPlate({ commit }, cookie) {
  axios.get("/api/album/newest?&cookie=" + cookie).then(res => {
    commit("getHomeNewPlate", res.data.albums);
  });
}
export function getAlbum({ commit }, cookie) {
  axios.get("/api/album/new?limit=12&cookie=" + cookie).then(res => {
    commit("getHomeAlbum", res.data.albums);
  });
}
